//
//  AskLeaveVC.m
//  SchoolTask
//
//  Created by tusm on 16/8/25.
//  Copyright © 2016年 sm. All rights reserved.
//

#import "AskLeaveVC.h"
#import "AskLeave.h"
#import "AskLeaveCell.h"
#import "MyLeaveVC.h"

@interface AskLeaveVC ()<UITableViewDelegate,UITableViewDataSource>

@property (nonatomic,retain) UITableView *tableView;
@end

@implementation AskLeaveVC

- (void)viewDidLoad {
    [super viewDidLoad];

    CGRect rect = [UIScreen mainScreen].bounds;
    AskLeave *view = [[AskLeave alloc]init];
    [self.view addSubview:view];
    
    _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 150, rect.size.width, 500)];
    _tableView.delegate = self;
    _tableView.dataSource = self;
    [self.view addSubview:_tableView];
   [_tableView registerNib:[UINib nibWithNibName:@"AskLeaveCell" bundle:nil] forCellReuseIdentifier:@"cell"];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return 10;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    AskLeaveCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
    [cell setLabel];
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    return 100;
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    
    MyLeaveVC *leave = [[MyLeaveVC alloc]init];
    [self.navigationController pushViewController:leave animated:NO];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
